<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
    <base href="<%=basePath%><%!private Object basePath;%>">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
    <title>“墨趣”网上书城</title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <style>
      table{
          font-family: Arial;
          font-size: 16px;
      }
      tbody{
          background-color:#c2c2c2;
      }
      #tr{
          background-color:#c2c2c2;
      }
    </style>
</head>
<body>
<div id="wrap">

       <div class="header">
       		<div class="logo"><a href="index.jsp"><img src="images/logo.gif" alt="" title="" border="0" /></a></div>
        <div id="menu">
            <ul>
            <li><a href="index.jsp">首页</a></li>
            <li><a href="about.jsp">关于我们</a></li>
            <li><a href="category.jsp">所有图书</a></li>
            <li><a href="specials.jsp">特别推荐</a></li>
            <li><a href="details.jsp">图书详情</a></li>
            <li class="selected"><a href="/orders/getlistByuid.action">我的订单</a></li>
            <c:if test="${empty loger}">
                <li><a href="myaccount.jsp">登录</a></li>
                <li><a href="register.jsp">注册</a></li>
            </c:if>
            <c:if test="${not empty loger}">
                <li><a href="/user/doexit.action">退出</a></li>
            </c:if>
            </ul>
        </div>     
            
            
       </div> 
       
       
       <div class="center_content">
       	<div class="left_content">
            <div class="title"><span class="title_icon"><img src="images/bullet1.gif" alt="" title="" /></span>我的订单</div>
        
        	<div class="feat_prod_box_details">
            
            <table class="cart_table" style="margin: auto">
            	<tr class="cart_title" id="tr">
                	<td>订单号</td>
                	<td>书名</td>
                    <td>下单时间</td>
                    <td>物流</td>
                    <td>状态</td>
                    <td>操作</td>
                </tr>
                <tbody id="nbody">
                <c:forEach items="${orderlist}" var="order">
                    <tr>
                        <td>${order.id}</td>
                        <td>${order.bname}</td>
                        <td><fmt:formatDate value="${order.ordertime}" pattern="yyyy-MM-dd HH:mm"/></td>
                        <td>${order.shipname}</td>
                            <%--<td>${order.state}</td>--%>
                        <td>
                            <c:if test="${order.state==0}">待付款</c:if>
                            <c:if test="${order.state==1}">已付款</c:if>
                            <c:if test="${order.state==2}">待发货</c:if>
                            <c:if test="${order.state==3}">已发货</c:if>
                            <c:if test="${order.state==4}">待收货</c:if>
                            <c:if test="${order.state==5}">已收货</c:if>
                            <c:if test="${order.state==6}">待评价</c:if>
                            <c:if test="${order.state==7}">已完成</c:if>
                        </td>
                        <td>
                            <a href="/orders/getByIdAndUid.action?id=${order.id}" >详情</a><br><%--href="javascript:void(0)" onclick="detail(${order.id})"--%>
                           <%-- <c:if test="${order.state==4}"><a href="javascript:void(0)" onclick="removecar(${car.id})">确认收货</a></c:if>
                            <c:if test="${order.state==6}"><a href="javascript:void(0)" onclick="removecar(${car.id})">评价</a></c:if>--%>
                            <c:if test="${order.state==4}"><a href="/orders/isOk.action?id=${order.id}" onclick="isOk()">确认收货</a></c:if>
                            <c:if test="${order.state==6}"><a href="/orders/getByIdAndUid2.action?id=${order.id}">评价</a></c:if>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>

            </div>	

            
        <div class="clear"></div>
        </div><!--end of left content-->

           <div class="right_content">

               <div class="cart">
                   <div class="title"><span class="title_icon"><img src="images/cart.gif" alt="" title="" /></span>我的购物车</div>
                   <div class="home_cart_content">
                       3 件物品 | <span class="red">总计: 100￥</span>
                   </div>
                   <a href="/shopcar/getShopcarByUid.action" class="view_cart">查看购物车</a>
               </div>

               <div class="title"><span class="title_icon"><img src="images/bullet3.gif" alt="" title="" /></span>关于我们的商店</div>
               <div class="about">
                   <p>
                       <img src="images/about.gif" alt="" title="" class="right" />
                       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;洛雷姆·伊普索姆·多尔坐在阿米特的座位上，他是一位非常优秀的运动员，他是一位非常出色的速度运动员，他在拉伯和多洛尔·马格纳·阿利夸尔的比赛中发挥了重要作用。但我是小维尼安人，诺查德人。洛雷姆·伊普索姆·多尔坐在阿米特的座位上，他是一位非常优秀的运动员，他是一位非常出色的速度运动员，他在拉伯和多洛尔·马格纳·阿利夸尔的比赛中发挥了重要作用。但我是小维尼安人，诺查德人。
                   </p>

               </div>

               <div class="right_box">

                   <div class="title"><span class="title_icon"><img src="images/bullet4.gif" alt="" title="" /></span>促销</div>
                   <div class="new_prod_box">
                       <a href="details.jsp">产品名称</a>
                       <div class="new_prod_bg">
                           <span class="new_icon"><img src="images/promo_icon.gif" alt="" title="" /></span>
                           <a href="details.jsp"><img src="images/thumb1.gif" alt="" title="" class="thumb" border="0" /></a>
                       </div>
                   </div>

                   <div class="new_prod_box">
                       <a href="details.jsp">产品名称</a>
                       <div class="new_prod_bg">
                           <span class="new_icon"><img src="images/promo_icon.gif" alt="" title="" /></span>
                           <a href="details.jsp"><img src="images/thumb2.gif" alt="" title="" class="thumb" border="0" /></a>
                       </div>
                   </div>

                   <div class="new_prod_box">
                       <a href="details.jsp">产品名称</a>
                       <div class="new_prod_bg">
                           <span class="new_icon"><img src="images/promo_icon.gif" alt="" title="" /></span>
                           <a href="details.jsp"><img src="images/thumb3.gif" alt="" title="" class="thumb" border="0" /></a>
                       </div>
                   </div>

               </div>

               <div class="right_box">

                   <div class="title"><span class="title_icon"><img src="images/bullet5.gif" alt="" title="" /></span>分类</div>

                   <ul class="list">
                       <li><a href="#">饰品</a></li>
                       <li><a href="#">书籍礼品</a></li>
                       <li><a href="#">特别推荐</a></li>
                       <li><a href="#">节日礼品</a></li>
                       <li><a href="#">饰品</a></li>
                       <li><a href="#">书籍礼品</a></li>
                       <li><a href="#">特别推荐</a></li>
                       <li><a href="#">节日礼品</a></li>
                       <li><a href="#">饰品</a></li>
                       <li><a href="#">书籍礼品</a></li>
                       <li><a href="#">特别推荐</a></li>
                   </ul>

                   <div class="title"><span class="title_icon"><img src="images/bullet6.gif" alt="" title="" /></span>伙伴</div>

                   <ul class="list">
                       <li><a href="#">饰品</a></li>
                       <li><a href="#">书籍礼品</a></li>
                       <li><a href="#">特别推荐</a></li>
                       <li><a href="#">节日礼品</a></li>
                       <li><a href="#">饰品</a></li>
                       <li><a href="#">书籍礼品</a></li>
                       <li><a href="#">特别推荐</a></li>
                       <li><a href="#">节日礼品</a></li>
                   </ul>
               </div>
           </div><!--end of right content-->


           <div class="clear"></div>
       </div><!--end of center content-->


    <div class="footer">
        <div class="left_footer"><img src="images/footer_logo.gif" alt="" title="" /><br /> <a href="http://www.cssmoban.com/" title="free templates">cssmoban</a></div>
        <div class="right_footer">
            <%--<a href="#">home</a>
            <a href="#">about us</a>
            <a href="#">services</a>
            <a href="#">privacy policy</a>
            <a href="#">contact us</a>
           --%>
        </div>
    </div>
</div>
<script src="back/assets/js/jquery-1.12.4.js"></script>
<script>
    $(function(){
        console.log("asdf");
        // $.getJSON("shopcar/getShopcarByUid.action","",function(res){
        //     for(var i=0;i<res.length;i++){
        //     var newtr=$("<tr></tr>");
        //     newtr.append("<td><a href=\"details.jsp\"><img src=\"images/cart_thumb.gif\" alt=\"\" title=\"\" border=\"0\" class=\"cart_thumb\" /></a></td>");
        //     newtr.append("<td>"+res[i].bname+"</td>");
        //     newtr.append(" <td>￥"+res[i].price+"</td>");
        //     newtr.append("<td>"+res[i].num+"</td>");
        //     newtr.append("<td>"+res[i].price * res[i].num+" </td>");
        //     newtr.append("<td><a href='javascript:void(0)'>移出购物车</a> </td>");
        //     $("#nbody").append(newtr);
        //     }
        // });
    })

    //查看订单详情
    function detail(id){
            if(confirm("弹出订单详情")){
                alert("123");
                $.get("/orders/getByIdAndUid.action","id="+id, function(res){
                    alert("操作成功");
                    alert(res);
                   /* location="orderdetail.jsp";*/
                });
        }
    }

    //确认收货
    function isOk(){
        if(confirm("确定要确认收货吗?")){
            alert("确认收货成功");}
           /* $.get("/orders/getByIdAndUid.action","id="+id, function(res){
                alert("操作成功");
                alert(res);
                !* location="orderdetail.jsp";*!
            });*/
    }

    //书籍评论
    function discuss(){

    }
</script>
</body>
</html>